home *** CD-ROM | disk | FTP | other *** search
/ Games to Treasure / Games to Treasure - Disc 2.iso / setup.bat < prev    next >
DOS Batch File  |  1994-03-04  |  3KB  |  119 lines

  1. @echo off
  2.  
  3. if not exist .\cdidx\cs\pic\emerald.gif goto fail
  4.  
  5. goto end0
  6.  
  7. :fail
  8. cls
  9. echo.
  10. echo.
  11. echo Sorry, you are on the wrong drive. Move to CD-ROM drive before executing.
  12. echo.
  13. pause
  14. echo.
  15. goto end0
  16.  
  17. :end0
  18. mode co80
  19.  
  20. @echo off
  21. set derml=
  22. set envtest1=
  23. set envtest2=
  24. set cdidxt=
  25. set cdr=
  26. set cdidx=
  27. set CDT=
  28. set bd=
  29. set goinst=
  30.  
  31. cls
  32.  
  33. echo Checking to see if you are on the correct drive...
  34. if not exist .\cdidx\cdidx.exe goto oops
  35. echo Checking your available environment space...
  36. set envtest1=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  37. set envtest2=xxxxxxxxxxxxxxx
  38. if  xxxxxxxxxxxxxxx == %envtest2% goto envok
  39. set envtest1=
  40. set envtest2=
  41. goto envnok
  42. :envok
  43. set envtest1=
  44. set envtest2=
  45. echo Environment space adequate.
  46. goto envcont
  47.  
  48. :envnok
  49. cls
  50. echo.
  51. echo.
  52. echo.
  53. echo                             !!!!!! WARNING !!!!!!
  54. echo.
  55. echo You do not have enough environment space to install the CdIdx variables. 
  56. echo Please consult your DOS manual about expanding it. You need at least
  57. echo 70 bytes of free environment space to complete the SETUP and INSTALL processes.
  58. echo.
  59. set cont=n
  60. pause
  61. cls
  62. goto end
  63.  
  64. :envcont
  65. echo @echo off >c:\tmp.bat
  66. echo Determining which drive is your CD-ROM drive...
  67. cd >c:\tmp1.dat
  68. \cdidx\cstring -f1 -d: <c:\tmp1.dat >c:\tmp2.dat
  69. \cdidx\strdt s/^/"set CDR=" <c:\tmp2.dat >>c:\tmp.bat
  70.  
  71. echo Determining your boot drive...
  72.  
  73. set >c:\tmp1.dat
  74. \cdidx\fstring "COMSPEC=" <c:\tmp1.dat >c:\tmp2.dat
  75. \cdidx\cstring -c9-9 <c:\tmp2.dat >c:\tmp3.dat
  76. \cdidx\strdt s/^/"set BD=" <c:\tmp3.dat >>c:\tmp.bat
  77. echo Setting Environment Variables (Running generated C:\TMP.BAT)...
  78. call c:\tmp.bat
  79. echo Cleanup: Erasing C:\tmp1.dat, C:\tmp2.dat, C:\tmp3.dat...
  80. erase C:\tmp1.dat
  81. erase C:\tmp2.dat
  82. erase C:\tmp3.dat
  83.  
  84. echo.
  85. echo.
  86. echo                                   NOTICE:
  87. echo.
  88. echo       Directory Creation may fail if directory C:\CDIDXTMP already exists.
  89. echo        This is not a problem, just shows you have installed CdIdx before.
  90. echo.
  91. pause
  92. echo.
  93. echo Attemping to create %bd%:\cdidxtmp directory...
  94. md %bd%:\cdidxtmp >\nul
  95. set CDT=\cdidxtmp
  96. set cdidx=%bd%%cdr%1%CDT%
  97.  
  98. echo Setup finished.
  99.  
  100. echo.
  101. echo   Boot drive was found to be drive: %bd%:
  102. echo CD-ROM drive was found to be drive: %cdr%:
  103. echo.
  104. echo If this is INCORRECT, you may need to run MSETUP to specify them.
  105. echo.
  106. goto end
  107.  
  108. :oops
  109. cls 
  110. echo.
  111. echo.
  112. echo.
  113. echo                          !!!!! WARNING !!!!!
  114. echo.
  115. echo You must make the drive you run SETUP.BAT from your default drive.
  116. goto end
  117.  
  118. :end
  119. echo.